//
// Created by richa on 2019/11/16.
//

#ifndef GREENHOUSEMA_HEATSTORESIMTEMPERATURESENSOR_H
#define GREENHOUSEMA_HEATSTORESIMTEMPERATURESENSOR_H

#include "SimLinearSensor.h"
#include <thread>

class HeatStoreSimTemperatureSensor{
public:
    HeatStoreSimTemperatureSensor(uint16_t *outputExchangerAddr, uint16_t *outputWaterAddr, uint8_t *pumpFlag);

    void setIllumination(int i);

private:
    uint16_t * output_exchanger_addr = nullptr;
    uint16_t * output_water_addr = nullptr;
    uint8_t * pumpFlag = nullptr;
    int illumination;
    SimLinearSensor waterTemperatureSensor = SimLinearSensor(100, 1);
    SimLinearSensor exchangerTemperatureSensor = SimLinearSensor(100, 1);;
    std::thread illuminationInputThread;
    std::thread outputToAddrThread;
private:
    void initIlluminationInputThread();
    void initOutputToAddrThread();

};


#endif //GREENHOUSEMA_HEATSTORESIMTEMPERATURESENSOR_H
